const particlesOptions = () => {
    return {
        background: {
            color: {
                value: 'transparent' // 背景颜色
            }
        },
        fpsLimit: 120, // 帧数限制
        particles: { // 粒子
            number: {
                density: { // 密度
                    enable: true,
                },
                value: 50 // 粒子数量
            },
            color: { // 粒子颜色
                value: "#ffffff",
                animation: { // 颜色变化
                    enable: true,
                    speed: -70,
                    sync: true // 同时变化
                }
            },
            shape: { // 粒子形状
                type: 'circle' // 圆
            },
            move: {
                enable: true, // 开启移动
                direction: 'top', // 移动方向 none: 随机运动
                speed: {
                    min: 0.5,
                    max: 1
                }, // 移动速度
                straight: false, // 是否直线移动
                gravity: { // 重力
                    enable: false,
                    acceleration: 1
                },
                outModes: { // 碰撞行为 bounce: 反弹  out: 消失
                    default: "out",
                },
            },
            opacity: { // 粒子透明度
                value: { min: 0.2, max: 0.5 },
                random: false,
                animation: {
                    enable: true,
                    minimumValue: 0,
                    speed: 0.5,
                    startValue: 1,
                    destroy: 0
                }
            },
            size: {
                value: { min: 1, max: 2 }
            },
            collisions: {
                enable: false, // 是否开启碰撞检测
            },
            // life: {
            //     duration: {
            //         value: 2 // 粒子存活时间
            //     },
            //     count: 1, // 生成次数
            // },
        },
        detectRetina: true,
    }
}

const winOptions = () => {
    return {
        particles: {
            number: {
                value: 0
            },
            color: {
                value: ["#1E00FF", "#FF0061", "#E1FF00", "#00FF9E"]
            },
            shape: {
                type: ["circle", "square"]
            },
            opacity: {
                value: {
                    max: 1,
                    min: 0
                },
                animation: {
                    enable: true,
                    speed: 2,
                    startValue: "max",
                    destroy: "min"
                }
            },
            size: {
                value: { min: 3, max: 7 }
            },
            life: {
                duration: {
                    sync: true,
                    value: 5
                },
                count: 1
            },
            move: {
                enable: true,
                gravity: {
                    enable: true,
                    acceleration: 20
                },
                speed: {
                    min: 25,
                    max: 50
                },
                drift: {
                    min: -2,
                    max: 2
                },
                decay: 0.05,
                direction: "none",
                outModes: {
                    default: "destroy",
                    top: "none"
                }
            },
            rotate: {
                value: {
                    min: 0,
                    max: 360
                },
                direction: "random",
                move: true,
                animation: {
                    enable: true,
                    speed: 60
                }
            },
            tilt: {
                direction: "random",
                enable: true,
                move: true,
                value: {
                    min: 0,
                    max: 360
                },
                animation: {
                    enable: true,
                    speed: 60
                }
            },
            roll: {
                darken: {
                    enable: true,
                    value: 25
                },
                enable: true,
                speed: {
                    min: 15,
                    max: 25
                }
            },
            wobble: {
                distance: 30,
                enable: true,
                move: true,
                speed: {
                    min: -15,
                    max: 15
                }
            }
        },
        interactivity: {
            detectsOn: "canvas",
            events: {
                resize: true
            }
        },
        detectRetina: true,
        responsive: [
            {
                maxWidth: 700,
                options: {
                    particles: {
                        move: {
                            speed: 30,
                            decay: 0.05
                        }
                    }
                }
            }
        ],
        emitters: [
            {
                direction: "top-right",
                rate: {
                    delay: 0.1,
                    quantity: 2
                },
                position: {
                    x: 0,
                    y: 50
                },
                size: {
                    width: 0,
                    height: 0
                }
            },
            {
                direction: "top-left",
                rate: {
                    delay: 0.1,
                    quantity: 2
                },
                position: {
                    x: 100,
                    y: 50
                },
                size: {
                    width: 0,
                    height: 0
                }
            }
        ]
    }
}

const indexOptions = () => {
    return {
        particles: {
            number: {
                value: 20, // Adjust the number of particles as needed
            },
            color: {
                value: "#CCCCCC", // Smoke color
            },
            shape: {
                type: "circle",
            },
            opacity: {
                value: 0.5, // Adjust the opacity to control the density of the smoke
                animation: {
                    enable: true,
                    speed: 0.2,
                    minimumValue: 0.1,
                    sync: false,
                },
            },
            size: {
                value: { min: 3, max: 5 },
                random: true,
                animation: {
                    enable: true,
                    speed: 0.2,
                    minimumValue: 5,
                    sync: true,
                },
            },
            move: {
                enable: true,
                direction: "none", // Make particles move randomly
                speed: 1, // Adjust the speed of particle movement
                outMode: "out", // Define how particles behave when they move out of the canvas
            },
        },
    }
}

const fireWorksOptions = () => {
    return {
        name: "Fireworks Mask",
        fullScreen: {
            enable: true
        },
        background: {
          color: "#000000",
          image: "url('https://particles.js.org/images/background3.jpg')",
          position: "50% 50%",
          repeat: "no-repeat",
          size: "cover"
        },
        backgroundMask: {
          enable: true,
          cover: {
            color: "#000"
          }
        },
        emitters: {
          direction: "top",
          life: {
            count: 0,
            duration: 0.1,
            delay: 0.1
          },
          rate: {
            delay: 0.15,
            quantity: 1
          },
          size: {
            width: 100,
            height: 0
          },
          position: {
            y: 100,
            x: 50
          }
        },
        particles: {
          color: {
            value: "#fff"
          },
          number: {
            value: 0
          },
          destroy: {
            bounds: {
              top: 30
            },
            mode: "split",
            split: {
              count: 1,
              factor: {
                value: 0.333333
              },
              rate: {
                value: 100
              },
              particles: {
                stroke: {
                  width: 0
                },
                color: {
                  value: ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"]
                },
                number: {
                  value: 0
                },
                collisions: {
                  enable: false
                },
                destroy: {
                  bounds: {
                    top: 0
                  }
                },
                opacity: {
                  value: {
                    min: 0.1,
                    max: 1
                  },
                  animation: {
                    enable: true,
                    speed: 0.7,
                    sync: false,
                    startValue: "max",
                    destroy: "min"
                  }
                },
                effect: {
                  type: "trail",
                  options: {
                    trail: {
                      length: {
                        min: 5,
                        max: 10
                      }
                    }
                  }
                },
                shape: {
                  type: "circle"
                },
                size: {
                  value: 2,
                  animation: {
                    enable: false
                  }
                },
                life: {
                  count: 1,
                  duration: {
                    value: {
                      min: 1,
                      max: 2
                    }
                  }
                },
                move: {
                  enable: true,
                  gravity: {
                    enable: true,
                    acceleration: 9.81,
                    inverse: false
                  },
                  decay: 0.1,
                  speed: {
                    min: 10,
                    max: 25
                  },
                  direction: "outside",
                  outModes: "destroy"
                }
              }
            }
          },
          life: {
            count: 1
          },
          effect: {
            type: "trail",
            options: {
              trail: {
                length: {
                  min: 10,
                  max: 30
                },
                minWidth: 1,
                maxWidth: 1
              }
            }
          },
          rotate: {
            path: true
          },
          shape: {
            type: "circle"
          },
          size: {
            value: 1
          },
          move: {
            enable: true,
            gravity: {
              acceleration: 15,
              enable: true,
              inverse: true,
              maxSpeed: 100
            },
            speed: {
              min: 10,
              max: 20
            },
            outModes: {
              default: "destroy",
              top: "none"
            }
          }
        },
    }
}


const spaceOptions = () => {
    return {
        particles: {
            groups: {
            z5000: {
                number: {
                    value: 100
                },
                zIndex: {
                    value: 5000
                }
            },
            z7500: {
                number: {
                value: 30
                },
                zIndex: {
                value: 75
                }
            },
            z2500: {
                number: {
                value: 50
                },
                zIndex: {
                value: 25
                }
            },
            z1000: {
                number: {
                value: 40
                },
                zIndex: {
                value: 10
                }
            }
            },
            number: {
                value: 200,
                density: {
                    enable: false,
                    area: 20
                },
            },
            color: {
                value: "#fff",
            },
            shape: {
                type: "circle"
            },
            opacity: {
                value: { min: 0.05, max: 0.2 },
                random: false,
                animation: {
                    enable: false,
                    speed: 3,
                    sync: false
                }
            },
            size: {
                value: 4
            },
            move: {
                angle: {
                    value: 10,
                    offset: 0
                },
                enable: true,
                speed: 0.5,
                direction: "right",
                random: false,
                straight: false,
                outModes: "out"
            },
            zIndex: {
                value: 5,
                opacityRate: 0.5
            }
        },
        interactivity: {
            detectsOn: "canvas",
            events: {
                resize: true
            },
            modes: {
                grab: {
                    distance: 400,
                    links: {
                        opacity: 1
                    }
                },
                bubble: {
                    distance: 400,
                    size: 40,
                    duration: 2,
                    opacity: 0.8
                },
                remove: {
                    quantity: 2
                }
            }
        },
        detectRetina: true,
        background: {
            color: "transparent"
        },
        emitters: {
            position: {
                y: 55,
                x: -30
            },
            rate: {
                delay: 7,
                quantity: 1
            },
            size: {
            width: 0,
            height: 0
            },
            particles: {
            shape: {
                type: "images",
                options: {
                images: [
                    {
                    src: "https://particles.js.org/images/amongus_blue.png",
                    width: 205,
                    height: 267
                    },
                    {
                    src: "https://particles.js.org/images/amongus_cyan.png",
                    width: 207,
                    height: 265
                    },
                    {
                    src: "https://particles.js.org/images/amongus_green.png",
                    width: 204,
                    height: 266
                    },
                    {
                    src: "https://particles.js.org/images/amongus_lime.png",
                    width: 206,
                    height: 267
                    },
                    {
                    src: "https://particles.js.org/images/amongus_orange.png",
                    width: 205,
                    height: 265
                    },
                    {
                    src: "https://particles.js.org/images/amongus_pink.png",
                    width: 205,
                    height: 265
                    },
                    {
                    src: "https://particles.js.org/images/amongus_red.png",
                    width: 204,
                    height: 267
                    },
                    {
                    src: "https://particles.js.org/images/amongus_white.png",
                    width: 205,
                    height: 267
                    }
                ]
                }
            },
            opacity: {
                value: 1
            },
            size: {
                value: 40
            },
            move: {
                speed: 10,
                outModes: {
                default: "destroy",
                left: "none"
                },
                straight: true
            },
            zIndex: {
                value: 0
            },
            rotate: {
                value: {
                min: 0,
                max: 360
                },
                animation: {
                enable: true,
                speed: 10,
                sync: true
                }
            }
            }
        }
    }
}

const water = () => {
    return {
        emitters: {
            size: {
                width: 100,
                height: 0
            },
            position: {
                x: 50,
                y: 100
            },
            rate: {
                delay: 0.1,
                quantity: 2
            }
        },
        particles: {
            number: {
                value: 0,
                density: {
                    enable: true,
                    value_area: 800
                }
            },
            color: {
                value: "#ffffff"
            },
            shape: {
                type: "circle"
            },
            opacity: {
                value: { min: 0.3, max: 0.5 },
            },
            size: {
                value: { min: 0.1, max: 10 },
                animation: {
                    enable: true,
                    speed: 3,
                    sync: false,
                    startValue: "min",
                    destroy: "max"
                }
            },
            move: {
                enable: true,
                speed: 5,
                outModes: "destroy",
                direction: "right",
                random: false,
                straight: false,
            }
        },
        background: {
            color: "transparent"
        },
        zIndex: {
            value: 0,
        }
    }
}

export {
    particlesOptions,
    winOptions,
    indexOptions,
    spaceOptions,
    fireWorksOptions,
    water,
}